﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Brushes.xaml" />
    </ResourceDictionary.MergedDictionaries>
    <Style TargetType="DataGrid">
        <Setter Property="CanUserResizeColumns" Value="false" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="{StaticResource COLOR_DARKGRAY}" />
        <Setter Property="HorizontalGridLinesBrush" Value="{StaticResource COLOR_DARKGRAY}" />
        <Setter Property="VerticalGridLinesBrush" Value="{StaticResource COLOR_DARKGRAY}" />
        <!--
            <Setter Property="VerticalGridLinesBrush">
            <Setter.Value>
            <SolidColorBrush Color="{DynamicResource COLOR_DARKGRAY}" />
            </Setter.Value>
            </Setter>
        -->
    </Style>

    <!--  标题栏样式  -->
    <!--
        <Style  TargetType="DataGridColumnHeader" >
        <Setter Property="Width" Value="50"/>
        <Setter Property="Height" Value="30"/>
        <Setter Property="FontSize" Value="14" />
        <Setter Property="Background" Value="White" />
        <Setter  Property="FontWeight"  Value="Bold"/>
        </Style>
    -->

    <Style TargetType="DataGridColumnHeader">
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="MinWidth" Value="0" />
        <Setter Property="MinHeight" Value="28" />
        <Setter Property="Foreground" Value="#323433" />
        <Setter Property="FontSize" Value="14" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="DataGridColumnHeader">
                    <Border x:Name="BackgroundBorder"
                            Width="Auto"
                            BorderBrush="{StaticResource COLOR_DARKGRAY}"
                            BorderThickness="0,1,0,1">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <ContentPresenter Margin="0,0,0,0"
                                              HorizontalAlignment="Center"
                                              VerticalAlignment="Center" />
                            <Path x:Name="SortArrow"
                                  Grid.Column="2"
                                  Width="8"
                                  Height="6"
                                  Margin="0,0,50,0"
                                  VerticalAlignment="Center"
                                  Data="M0,0 L1,0 0.5,1 z"
                                  Fill="White"
                                  RenderTransformOrigin="1,1"
                                  Stretch="Fill"
                                  Visibility="Collapsed" />
                            <Rectangle Grid.ColumnSpan="1"
                                       Width="1"
                                       HorizontalAlignment="Right"
                                       Fill="{DynamicResource COLOR_DARKGRAY}" />
                            <!--
                                <TextBlock  Background="Red">
                                <ContentPresenter></ContentPresenter></TextBlock>
                            -->
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Height" Value="25" />
    </Style>

    <Style TargetType="DataGridRow">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Height" Value="25" />
        <Setter Property="Foreground" Value="Black" />
        <Style.Triggers>

            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="LightGray" />
            </Trigger>

            <Trigger Property="IsSelected" Value="True">
                <Setter Property="Foreground" Value="OrangeRed" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="DataGridCell">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="DataGridCell">
                    <TextBlock VerticalAlignment="Center" TextAlignment="Center">
                        <ContentPresenter />
                    </TextBlock>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsSelected" Value="True">
                <Setter Property="Foreground" Value="OrangeRed" />
            </Trigger>
        </Style.Triggers>
    </Style>
</ResourceDictionary>